package com.xhs.main.service.xsb.impl;

import com.xhs.main.dao.xsb.XsbPlanDao;
import com.xhs.main.entity.xsb.Plan;
import com.xhs.main.service.xsb.XsbPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author hjr
 * @create 2020-10-16-上午 9:57
 */
@Service
public class XsbPlanServiceImpl implements XsbPlanService {

    @Autowired
    XsbPlanDao xsbPlanDao;


    @Override
    public void addPlan(Plan plan) {

          xsbPlanDao.insertPlan(plan);
    }

    @Override
    public List<Plan> getAllPlan() {
        List<Plan> plans = xsbPlanDao.selectAllPlan();
        return plans;
    }

    @Override
    public List<Plan> getPlanByVague(Plan plan) {
        List<Plan> plans = xsbPlanDao.selectAllPlanByVague(plan);
        return plans;
    }

    @Override
    public  List<Plan>  updatePlan(Plan plan) {
        xsbPlanDao.updatePlan(plan);
        List<Plan> plans = xsbPlanDao.selectAllPlan();
        return plans;
    }
}
